﻿Imports System.Collections.ObjectModel
Imports PTIC_Util


''' <summary>
''' ViewModel d'un élément de l'accodéon en bas à gauche de l'écran (par exemple le bouton "ETUDES")
''' Les éléments affichés dans la tree-view lorsque le bouton est coché sont stockés dans la propriété Body
''' </summary>
''' <remarks></remarks>
Public Class V2ViewModelAccordeonMenuItem
    Inherits ViewModelBase

    Public Property Key As String

    Private _Header As Object
    Public Property Header As Object
        Get
            Return _Header
        End Get
        Set(ByVal value As Object)
            OnPropertyChanging("Header")
            Dim args As New PropertyChangeEventArgs(Of Object)(_Header, value)
            OnHeaderChange(args)
            _Header = args.NewValue
            OnPropertyChanged("Header")
        End Set
    End Property
    Protected Overridable Sub OnHeaderChange(ByVal args As PropertyChangeEventArgs(Of Object))
        RaiseEvent HeaderChange(Me, args)
    End Sub
    Public Event HeaderChange As PropertyChangeEventHandler(Of Object)


    Private _Body As V2ViewModelTrvMenu
    Public Property Body As V2ViewModelTrvMenu
        Get
            Return _Body
        End Get
        Set(ByVal value As V2ViewModelTrvMenu)
            OnPropertyChanging("Body")
            Dim args As New PropertyChangeEventArgs(Of V2ViewModelTrvMenu)(_Body, value)
            OnBodyChange(args)
            _Body = args.NewValue
            OnPropertyChanged("Body")
        End Set
    End Property
    Protected Overridable Sub OnBodyChange(ByVal args As PropertyChangeEventArgs(Of V2ViewModelTrvMenu))
        RaiseEvent BodyChange(Me, args)
    End Sub
    Public Event BodyChange As PropertyChangeEventHandler(Of V2ViewModelTrvMenu)


    Private _Icone As String
    Public Property Icone As String
        Get
            Return _Icone
        End Get
        Set(ByVal value As String)
            OnPropertyChanging("Icone")
            Dim args As New PropertyChangeEventArgs(Of String)(_Icone, value)
            OnIconeChange(args)
            _Icone = args.NewValue
            OnPropertyChanged("Icone")
        End Set
    End Property
    Protected Overridable Sub OnIconeChange(ByVal args As PropertyChangeEventArgs(Of String))
        RaiseEvent IconeChange(Me, args)
    End Sub
    Public Event IconeChange As PropertyChangeEventHandler(Of String)





End Class


